package com.sweet.controller;

import com.sweet.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class OrderController {

    @Autowired
    private RestTemplate restTemplate;

    private static final String ZK_URL = "http://sweet-provider-pay-zk8004";

    @GetMapping("/consumer/zk")
    public Result getOrder() {
        return restTemplate.getForObject(ZK_URL + "/zk", Result.class);
    }
}
